package com.tsxy.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tsxy.common.APIResult;
import com.tsxy.mapper.AreaMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/area")
public class AreaController {

    @Resource
    private AreaMapper areaMapper;

    @GetMapping("/getList")
    public APIResult getall(){
        new QueryWrapper<>();
        return APIResult.success(areaMapper.selectList(new QueryWrapper<>()));
    }

    @GetMapping("/getAll")
    public APIResult getAllChildren(){


        return APIResult.success(areaMapper.getAllChildren());
    }

}
